Only set the accesible label if it is non-empty
authorChristian Dywan <christian@lanedo.com>
Mon, 26 Oct 2009 23:30:54 +0000 (00:30 +0100)
committerJavier Jardón <jjardon@gnome.org>
Mon, 26 Oct 2009 23:34:49 +0000 (00:34 +0100)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599446

gtk/gtktoolbutton.c

index 6db835861d4b878cd5a9ba7cecb5c8255669fc24..5975a5168937c3fb32b4abc4a906466f3d30b10f 100644 (file)
@@ -916,11 +916,14 @@ gtk_tool_button_set_label (GtkToolButton *button,
   button->priv->label_text = g_strdup (label);
   button->priv->contents_invalid = TRUE;     
 
-  elided_label = _gtk_toolbar_elide_underscores (label);
-  accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button));
-  atk_object_set_name (accessible, elided_label);
+  if (label)
+    {
+      elided_label = _gtk_toolbar_elide_underscores (label);
+      accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button));
+      atk_object_set_name (accessible, elided_label);
+      g_free (elided_label);
+    }
 
-  g_free (elided_label);
   g_free (old_label);
  
   g_object_notify (G_OBJECT (button), "label");